<!--
 * @Author: moxunjinmu
 * @Date: 2025-04-08 19:44:41
 * @Description: 
-->
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>贪吃蛇游戏</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div class="game-container">
        <h1>贪吃蛇游戏</h1>
        <div class="game-info">
            <div class="score-container">分数: <span id="score">0</span></div>
            <div class="speed-container">
                <label for="speed-control">速度: </label>
                <input type="range" id="speed-control" min="1" max="10" value="5">
                <span id="speed-value">5</span>
            </div>
        </div>
        <canvas id="game-canvas" width="400" height="400"></canvas>
        <div class="controls">
            <button id="start-btn">开始游戏</button>
            <button id="pause-btn">暂停</button>
            <button id="restart-btn">重新开始</button>
        </div>
        <div class="instructions">
            <h2>游戏说明</h2>
            <p>使用键盘方向键控制蛇的移动方向</p>
            <p>吃到食物可以增加分数和蛇的长度</p>
            <p>撞到墙壁或自己的身体游戏结束</p>
            <p>使用滑块调整蛇的移动速度</p>
        </div>
    </div>
    <script src="script.js"></script>
</body>
</html>